home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PASCAL
/
0195.ZIP
/
MKRMDIR.LIB
< prev
next >
Wrap
Text File
|
1984-12-17
|
2KB
|
46 lines
{@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
The purchaser of these procedures and functions may include them in COMPILED
programs freely, but may not sell or give away the source text.
Make or remove a directory. Input is a full path name,
including the drive, and "M" for Make or "R" for Remove.
A one-byte error code is returned. You cannot remove the
current director. If you try to remove a non-empty
directory, you'll get error code 5, "access denied".
NOTE that any program that INCLUDEs this file MUST also include the
type declarations contained in REGPACK.TYP and FILENAME.TYP,
and may want to include ERRMESSG.LIB
}
{@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
procedure DoSubDirectory(activity : char ;
VAR filename : filename_type;
VAR error : byte);
var
registers : regpack;
begin
filename[length(filename)+1] := #0;
with registers do
begin
DS := seg(filename);
DX := ofs(filename)+1;
case UpCase(activity) of
'M': AX := $39 shl 8;
'R': AX := $3A shl 8;
end;
if UpCase(activity) in ['M','R'] then
begin
MSDOS(registers);
if flags and 1 = 1 then
error := AX and $00FF
else error := 0;
end
else
begin
WriteLn('Program error--input to "DoSubDirectory" must by M or R.');
halt;
end;
end; {with}
end;